$OpenBSD: README,v 1.39 2015/07/30 16:04:38 kirby Exp $

+-----------------------------------------------------------------------
| Running ${FULLPKGNAME} on OpenBSD
+-----------------------------------------------------------------------

ownCloud is installed under
    ${INSTDIR}

Official documentation is available at:
    http://doc.owncloud.org/server/${VR}/admin_manual/

Post-installation instructions
==============================

chroot(2)
---------
ownCloud attempts to use the UTF-8 locale, which does not work by
default inside the /var/www chroot. This causes warning messages in
ownCloud's admin configuration page and logs. To prevent this problem,
run the following as root:
    # mkdir -p /var/www/usr/share/locale/UTF-8/
    # cp /usr/share/locale/UTF-8/LC_CTYPE \
        /var/www/usr/share/locale/UTF-8/

OpenBSD HTTP daemon
-------------------
TBD

nginx
-----
This configuration chunk can be adapted and used in a server{} block:

-8<---------------------------------------------------------------------
        client_max_body_size 10G; # set max upload size
        fastcgi_buffers 64 4K;
        rewrite ^/caldav(.*)$ /remote.php/caldav$1 redirect;
        rewrite ^/carddav(.*)$ /remote.php/carddav$1 redirect;
        rewrite ^/webdav(.*)$ /remote.php/webdav$1 redirect;
        error_page 403 /core/templates/403.php;
        error_page 404 /core/templates/404.php;


        location ~ ^(.+?\.php)(/.*)?$ {
            try_files $1 = 404;
            include fastcgi_params;
            fastcgi_param SCRIPT_FILENAME $document_root$1;
            fastcgi_param PATH_INFO $2;
            fastcgi_pass   unix:run/php-fpm.sock;
        }

        location ~ ^/(data|config|\.ht|db_structure\.xml|README) {
                deny all;
        }

        location / {
            # The following 2 rules are only needed with webfinger
            rewrite ^/.well-known/host-meta /public.php?service=host-meta last;
            rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json last;

            rewrite ^/.well-known/carddav /remote.php/carddav/ redirect;
            rewrite ^/.well-known/caldav /remote.php/caldav/ redirect;

            rewrite ^(/core/doc/[^\/]+/)$ $1/index.html;

            try_files $uri $uri/ index.php;
        }

        # Optional: set long EXPIRES header on static assets
        location ~* ^.+\.(jpg|jpeg|gif|bmp|ico|png|css|js|swf)$ {
            expires 30d;
            # Optional: Don't log access to assets
            access_log off;
        }
-8<---------------------------------------------------------------------

Apache2
-------
Apache2 configuration for ownCloud is stored under:
    ${PREFIX}/conf/modules.sample/httpd-owncloud.conf

It needs to be included by adding the following to ${SYSCONFDIR}/apache2/httpd2.conf:
    Include ${PREFIX}/conf/modules.sample/httpd-owncloud.conf

PHP
---
Default PHP values for Apache2 are set under:
    ${TINSTDIR}/config/.htaccess

OpenBSD HTTP daemon users can match these .htaccess file values by
editing ${SYSCONFDIR}/php-${MODPHP_VERSION}.ini or ${SYSCONFDIR}/php-fpm.conf.

nginx users can match these .htaccess file values by configuring
fastcgi_param with a PHP_VALUE in ${SYSCONFDIR}/nginx/nginx.conf.

For enhanced performance, a PHP opcode cache can be used, either
use "opcache" (built-in to PHP 5.5+, enable "opcache.ini" to use it)
or install xcache.

Database configuration
----------------------
See the following URL for setting up a database for ownCloud:
    https://doc.owncloud.org/server/${VR}/admin_manual/configuration_database/linux_database_configuration.html

ownCloud can work with a PostgreSQL, MariaDB or SQLite3 database.
Support for SQLite3 is included with the main php package; to use
another database, the corresponding package needs to be installed
*before* setting up ownCloud:
    php-pdo_pgsql or php-pdo_mysql

Configuration is done under:
    ${INSTDIR}/config/config.php
and the default "datadirectory" is set to:
    ${TINSTDIR}/data
When running chrooted, /var/www must be stripped from the paths.

Cron job
--------
ownCloud needs to run background jobs on a regular basis. By default, it
will execute one task with each page loaded ("AJAX" option in the admin
interface). The prefered way is to use a cron(8) job instead.
(see http://<hostname>/owncloud/index.php/settings/admin#backgroundjobs)
e.g.
*/15	*	*	*	*	/usr/bin/ftp -Vo - http://<hostname>/owncloud/cron.php >/dev/null

Authentication backends
-----------------------
When using a non-default user authentication backend (LDAP, IMAP, ...),
extra packages may be needed (e.g. php-ldap, php-imap).

Finishing and validating the installation
-----------------------------------------
Make sure the web server can resolve its hostname (e.g. if chrooted, by
creating /var/www/etc/hosts and/or /var/www/etc/resolv.conf).

Accessing http://<hostname>/owncloud with a Web browser will finish the
installation and create a new admin user.

Updating
========
Before updating to a new release, read:
    http://doc.owncloud.org/server/${VR}/admin_manual/maintenance/upgrade.html

When using a PostgreSQL or MariaDB, the corresponding MDB2 php package
must be installed to properly upgrade the database:
    php-pgsql or php-mysql

WebDAV access
=============
The personal WebDAV share can be accessed using the following URL (e.g.
with Nautilus, Thunar or Doplhin) and the corresponding user and
password for the share:
    http://<hostname>/owncloud/remote.php/webdav/

NOTE that it is highly recommended to use SSL on the webserver so that
access is done over https instead of http.

Synchronization
===============
The "owncloudclient" package (net/owncloudclient) is a graphical (QT)
application to synchronize with an ownCloud server.

Apps and dependencies
=====================
To keep dependencies to a minimum, not all dependencies for all
installed apps are enforced. It is the job of the administrator to
manually install required packages according to the non-default apps he
wants to enable.
